package item.mod;

import java.util.Random;

public class RandomMod {
	
	//generates a random Mod
	
	public static Mod random(int level) {
		Random r = new Random();
		
		//initialize 
		
		int condition = r.nextInt(100);
		int weight = r.nextInt(10) + 5 * level;
				
		//compute cost
				
		int cost = (condition - weight * 5) * level;
		
		double bonus[] = new double[10];
		for(int i = 0; i < bonus.length; i ++) {
			bonus[i] = 1.0 + (r.nextInt(level) - 5.0) / 100.0;
		}//calculate multipliers
		
		return new Mod(cost, condition, weight, level,
				bonus[0], bonus[1], bonus[2], bonus[3], bonus[4], 
				bonus[5], bonus[6], bonus[7], bonus[8], bonus[9]);
	}//end of method random
	
}//end of class RandomMod
